package android.timer.com;


import android.R.bool;
import android.app.AlertDialog;
import android.content.Context;
import android.content.DialogInterface;

public class Common {
	private Context currentContext;
	Boolean status;
	public Common(Context currentContext)
	{
		this.currentContext = currentContext;
		status = null;
	}
	public void MessageBox(String message, String title){
    	AlertDialog alertDialog = new AlertDialog.Builder(currentContext).create();
        alertDialog.setTitle(title);
        alertDialog.setMessage(message);
        alertDialog.setButton("OK", new DialogInterface.OnClickListener() {
          public void onClick(DialogInterface dialog, int which) {
            return;
        } }); 
        alertDialog.show();
    }
	 public Boolean ConfirmationMessageBox(String message, String title){
		 	
	    	AlertDialog alertDialog = new AlertDialog.Builder(currentContext).create();
	    	alertDialog = new AlertDialog.Builder(currentContext).create();
	        alertDialog.setTitle(title);
	        alertDialog.setMessage(message);
	        alertDialog.setButton("OK", new DialogInterface.OnClickListener() {
	          public void onClick(DialogInterface dialog, int which) {
	        	  MessageBox("Your feedback has been posted", "Feedback");
	        	  status = true;
	        } });
	        alertDialog.setButton2("Cancel", new DialogInterface.OnClickListener() {
	          public void onClick(DialogInterface dialog, int which) {
	        	  status =  false;
	           
	        }}); 
	        alertDialog.show();
	        return status;
	        
	    }
}

